Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve some basic structs #216

Merged
merged 4 commits into from
Sep 22, 2023
Merged

improve some basic structs #216

merged 4 commits into from
Sep 22, 2023

Conversation

XuyangSong
Copy link
Collaborator

  • Output the Taiga types(NoteCommitment and Anchor) in ShieldedResult
  • add a new struct, Anchor, to denote the roof of the Merkle tree.
  • improve and unify some interfaces
  • rename ActionInstance to ActionPublicInputs

#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct Anchor(pallas::Base);

impl Anchor {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think there is a need for a separate type for the anchor? Technically, the root is also a node.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now, the Anchor is exactly the root. I'm considering extending the Anchor struct. We probably will add more parameters to Anchor, like the block number, epoch, etc., so that we can add constraints in circuits and check them publicly. We discussed the proposal before but have yet to decide what to add.
Besides, Node is a little confusing; we also have the blockchain Node. I don't tend to use the Node struct outside of the Merkle tree and may make it private later.
Does it make any sense? If not, I can revert it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it does. However, the executor does work with Node objects too when constructing the tree.

@XuyangSong XuyangSong merged commit 1ebcf08 into main Sep 22, 2023
7 checks passed
@XuyangSong XuyangSong deleted the xuyang/improve_basic_structs branch September 22, 2023 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants